define(function () {
  /**
   * 点标绘
   * @param {Cesium.Viewer} viewer 基本视图
   * @param {Cesium.ScreenSpaceEventHandler} handler 屏幕监听事件
   * @param {Cesium.CustomDataSource}plotEntities 标绘实体集合
   */
  let pointPlotting = function (viewer, handler, plotEntities) {
    handler.setInputAction((event) => {
      let earthPosition = viewer.camera.pickEllipsoid(event.position, viewer.scene.globe.ellipsoid)

      //点实体初始化
      let point = new Cesium.PointGraphics({
        color: Cesium.Color.RED,
        pixelSize: 4,
        outlineColor: Cesium.Color.BLACK,
        outlineWidth: 1
      })

      // 将点添加到地球上
      let entity = plotEntities.entities.add({
        description: 'plot',
        name: 'point',
        position: earthPosition,
        point: point
      })
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
  }
  return pointPlotting
})